Skip to content

Add a smaller intent-drift check, grounded in a real Copilot session - #6367

Open
shauryagangrade wants to merge 12 commits into
github:mainfrom
shauryagangrade:add-intent-drift-skill-v2
Open

shauryagangrade wants to merge 12 commits into
github:mainfrom
shauryagangrade:add-intent-drift-skill-v2

Conversation

@shauryagangrade

@shauryagangrade shauryagangrade commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

What this adds

A diff-review skill for checking whether current work still matches the original request:

  • State the request and the test/behavior that decides done (full requested suite/acceptance, plus preserved security/input-validation constraints).
  • Inspect git status --short --untracked-files=all, git diff, and git diff --cached, and read untracked files.
  • Confirm a passing baseline, split mixed hunks into logical changes, and classify each as required or out of scope (keep and flag required controls such as input validation for human review when tests do not cover them).
  • Revert only out-of-scope changes (index first, then working tree), remove agent-created out-of-scope untracked files, re-run the acceptance check, and report a concrete verdict based on request, acceptance, and diff.

This skill is package-free: it uses only git and the repository's existing acceptance command. It does not install or run external PyPI/npm engine packages and does not rely on external alignment scores in the verdict.

Worked example

skills/intent-drift/examples/real-session.md includes:

  1. A real GitHub Copilot CLI 1.0.109 session (kept as a historical transcript) where a passing test fix also introduced unrelated edits; /intent-drift reverted out-of-scope changes and kept the required fix.
  2. An illustrative current-procedure walkthrough showing how the package-free SKILL.md flow applies to the same scenario, including keeping/flagging the discount clamp as input validation for human review.

The historical transcript is preserved verbatim and labeled as history, with a caveat that the current procedure keeps the discount clamp as input validation rather than reverting it.

Validation

  • npm run skill:validate — passes (intent-drift is valid)
  • npm run build — regenerated docs/marketplace outputs as needed
  • bash .github/scripts/maintenance/fix-line-endings.sh — run
  • Manual review of skills/intent-drift/SKILL.md and skills/intent-drift/examples/real-session.md against the current diff-review procedure

#6242 stays closed; this is a fresh PR.

Replace the heuristic scoring engine from github#6242 with a short diff-review procedure. The check uses the request's acceptance test to classify each change as required or out of scope, reverts only out-of-scope hunks, and re-runs the check.

The worked example is a real GitHub Copilot CLI session where a test fix also changed unrelated behavior; the check caught the scope creep and restored the minimal fix.
@shauryagangrade
shauryagangrade requested review from a team as code owners November 11, 2026 12:19
Copilot AI adaptive review requested due to automatic review settings November 11, 2026 12:19
@github-actions github-actions Bot added new-submission PR adds at least one new contribution skills PR touches skills labels Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🔒 PR Risk Scan Results

Scanned 2 changed file(s).

Severity Count
🔴 High 0
🟠 Medium 0
ℹ️ Info 0

✅ No matching risk patterns were detected in changed files.

This is an automated soft-gate report. Findings indicate review targets and do not block merge by themselves.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🚦 Submission status: 🛠️ Requires submitter fixes

Risk tier: merge-risk:high — Privileged execution, automation, or review-policy change
Required to merge: passing submission-gate checks plus 1 approval from reviewers with write access, including a maintainer with admin or maintain permission.

Why this tier
  • Label needs-review:HIGH flags a high contributor-risk signal

Automated checks

Check Status Details
Line endings ✅ Passed Passed · logs
Spelling ✅ Passed Passed · logs
Generated README consistency ✅ Passed Passed · logs
Skill validation ✅ Passed Passed · logs
Skill lint (vally) ✅ Passed Passed · logs
Risk scan ✅ Passed Passed · logs
Contributor reputation ✅ Passed Passed · logs
Duplicate resource scan ✅ Passed Passed · logs
PR quality signal ⏭️ Skipped Skipped by its workflow · logs

Action needed

  • Address the changes requested by aaronpowell, then push an update.

Review

  • Approvals: 0/1
  • Assigned reviewer: not assigned yet — comment /request-review to ask for one
  • Review target date: not set
  • Still needed: 1 more approval(s); an approval from a maintainer with admin or maintain permission; resolution of changes requested by aaronpowell
  • The core-maintainers pool is not staffed yet; an approver with admin or maintain permission is required instead.

Commands

Command Who What it does
/rerun-checks PR author, maintainers Re-runs failed or incomplete checks and re-evaluates this gate
/request-review PR author, maintainers Asks the review rotation to assign a reviewer (adds needs-reviewer)

Updated for 12886f3 · gate run · This comment is maintained automatically — see submission gate docs.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🔴 Contributor Reputation Check: HIGH risk

Check Risk
Profile HIGH
Credential audit NONE

Maintainers: please review this contributor before merging.
See the workflow run for full details.
Automated check powered by AGT.

@github-actions github-actions Bot added the needs-review:HIGH Contributor reputation check flagged HIGH risk label Nov 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Vally Lint Results

✅ All checks passed

Scope Checked
Skills 1
Agents 0
Total 1
Severity Count
❌ Errors 0
⚠️ Warnings 0
ℹ️ Advisories 0

Summary

Level Finding
ℹ️ ✅ intent-drift (2/2 checks passed)
ℹ️ ✓ [spec-compliance] All 1 skill(s) are spec-compliant.
ℹ️ ✓ spec-compliance: All spec checks passed.
ℹ️ ✓ [valid-refs] All file references across 1 skill(s) are valid.
ℹ️ ✓ valid-refs: All file references resolve to existing files within the skill directory.
ℹ️ 1 skill(s) linted, 1 passed
Full linter output
### Linting skills/intent-drift
✅ intent-drift (2/2 checks passed)
    ✓ [spec-compliance] All 1 skill(s) are spec-compliant.
        ✓ spec-compliance: All spec checks passed.
    ✓ [valid-refs] All file references across 1 skill(s) are valid.
        ✓ valid-refs: All file references resolve to existing files within the skill directory.

1 skill(s) linted, 1 passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The intent-drift workflow can miss staged, untracked, or mixed-hunk changes, reject necessary test updates, and report corrections without complete validation or an appropriate uncorrected verdict.

5 open issues
What changed in this PR

Adds a lightweight intent-drift skill to help Copilot identify and undo changes outside the user’s request, replacing the broader scoring-based approach proposed in #6242.

Changes:

  • Defines a diff-review procedure with acceptance checks, scope classification, selective reverts, and structured reporting.
  • Includes a real Copilot CLI session demonstrating removal of unrelated edits while preserving a test fix.
  • Registers the skill in the generated skills catalog.
File Description
skills/​intent-drift/​SKILL.md Defines the intent-drift review and correction procedure.
skills/​intent-drift/​examples/​real-session.md Documents a cart-test repair and subsequent scope correction.
docs/​README.skills.md Adds the skill’s installation command, description, and example link.

Review effort: Balanced (auto)

Comment thread skills/intent-drift/SKILL.md Resolved
Comment thread skills/intent-drift/SKILL.md Resolved
Comment thread skills/intent-drift/SKILL.md Resolved
Comment thread skills/intent-drift/SKILL.md Resolved
Comment thread skills/intent-drift/SKILL.md Resolved
Use the full requested test suite for necessity and post-revert checks, review staged and untracked changes, split mixed hunks before classification, add a drifted (uncorrected) verdict, and allow test updates that follow a requested behavior change.
Copilot AI adaptive review requested due to automatic review settings November 11, 2026 12:25
@shauryagangrade

Copy link
Copy Markdown
Contributor Author

Pushed ea988b0a to address the five review points:

  1. Full suite, not just the first failure — step 1 now defines acceptance as the full suite the request refers to, and step 5 re-runs that full suite after reverts.
  2. Staged and untracked changes — step 2 now inspects git diff, git diff --cached, and reads untracked files from git status.
  3. Mixed hunks — step 3 now splits each hunk into the smallest independently reviewable changes before applying the necessity test, and only judges a whole hunk when it truly cannot be split. The worked example now calls out that its single mixed hunk had to be split.
  4. Uncorrected verdict — the verdict is now on track | drifted (uncorrected) | drifted (corrected); drifted (corrected) is only allowed after the reverts are complete and the acceptance check passes, and a revert that breaks the check means the change was required.
  5. Test updates for requested behavior changes — the blanket test rule is replaced: weakening/skipping/deleting a test to make it pass is drift, but updating assertions that encode old behavior is required when the user asked to change that behavior.

Validation: npm run skill:validate passes, npm run build regenerated, line endings normalized.

@github-actions github-actions Bot added awaiting-automation and removed ready-for-review Submission passed intake validation and is ready for maintainer review labels Nov 11, 2026
@github-actions github-actions Bot added ready-for-review Submission passed intake validation and is ready for maintainer review and removed awaiting-automation labels Nov 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The workflow can miss staged or untracked drift and incorrectly direct removal of required changes or security controls when acceptance checks are incomplete or already failing.

3 open issues
1 previously missed issue

In code that hasn't changed since last review

Low severity Require security review before removing untested controls

skills/​intent-drift/​SKILL.md:46

When the acceptance suite omits unauthorized requests, this rule can classify a necessary authorization check as out of scope and direct its removal in step 5. Re-running the same suite will not detect that loss of protection. Include required security constraints in the acceptance criteria, and require review rather than reverting a security control solely because tests pass without it.

5 resolved since last review

Review effort: Balanced (auto)

Comment thread skills/intent-drift/SKILL.md Resolved
Comment thread skills/intent-drift/SKILL.md Resolved
Comment thread skills/intent-drift/SKILL.md Resolved
List every untracked file with --untracked-files=all, require a passing baseline before classification (otherwise report inconclusive), revert staged drift as well as working-tree drift and recheck both diffs, and never revert security controls just because tests pass without them.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because reading all untracked files risks exposing sensitive data, while agent-added tests can incorrectly justify out-of-scope changes.

No open issues 🎉

Review effort: Balanced (auto)

Copilot AI adaptive review requested due to automatic review settings November 11, 2026 12:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The skill runs third-party packages without an explicit approval step and unsafely interpolates request text into executable code, creating critical security risks.

7 open issues

Review effort: Max (auto)

Comment thread skills/intent-drift/SKILL.md Resolved
Comment thread skills/intent-drift/SKILL.md Resolved
Comment thread skills/intent-drift/SKILL.md Resolved
Comment thread skills/intent-drift/SKILL.md Resolved
Comment thread skills/intent-drift/SKILL.md Resolved
Comment thread skills/intent-drift/SKILL.md Resolved
Comment thread skills/intent-drift/SKILL.md Resolved

@aaronpowell aaronpowell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for narrowing this to a concrete diff-review workflow. The steps for splitting mixed hunks and restoring staged changes before working-tree changes give the skill a useful, evidence-based core. However, step 4 now requires installing the author's PyPI package and running npx -y intent-drift@1.1.0 on every invocation, making the scores part of the verdict. That brings back the scoring approach discussed in #6242, where the review found the score was not a dependable signal, and it also runs downloaded package code during routine use. Please remove the mandatory dual-engine step, or make it explicitly opt-in and keep its scores out of the verdict. The real-session example predates these engines, so please add GitHub Copilot validation of that path if you retain it.

@github-actions github-actions Bot added requires-submitter-fixes Submission has quality-gate findings that submitter must fix before maintainer review and removed ready-for-review Submission passed intake validation and is ready for maintainer review labels Nov 13, 2026
Clarify handling of drift results and engine scores.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI adaptive review requested due to automatic review settings November 20, 2026 05:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot AI adaptive review requested due to automatic review settings November 20, 2026 05:36
@shauryagangrade

Copy link
Copy Markdown
Contributor Author

@aaronpowell Thanks for the review — pushed f898ce10 to address this:

  • Removed the mandatory dual-engine step and all external package execution (intent-drift==0.1.3 / npx -y intent-drift@1.1.0), so the skill no longer installs/runs third-party code or uses alignment scores in the verdict.
  • The procedure is now a concrete diff review driven by the request, acceptance check, and the diff (verdict based on that evidence only).

Validation: npm run skill:validate and npm run build passed locally. Happy to adjust further if needed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The skill advertises pinned PyPI and npm engine cross-checks but invokes neither package and excludes external scores from its drift verdict, leaving the documented validation absent.

2 open issues
4 resolved since last review

Review effort: Max (adaptive)

Comment thread skills/intent-drift/SKILL.md Resolved
Clarify package-free diff-review workflow (no PyPI/npm engine checks or external alignment scores) and add a current-procedure GitHub Copilot validation walkthrough to the worked example while keeping the historical transcript labeled.
Copilot AI adaptive review requested due to automatic review settings November 20, 2026 07:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The PR description promises engine integration that the skill forbids, while the example contains inconsistent change classifications and insufficient evidence for its end-to-end validation claim.

3 open issues
2 resolved since last review

Review effort: Max (adaptive)

Comment thread skills/intent-drift/SKILL.md Resolved
Label current-procedure example as illustrative (not captured artifacts), classify discount clamp as kept/flagged required control, and document all reverted logical changes; align worked-example text with package-free workflow.
Copilot AI adaptive review requested due to automatic review settings November 20, 2026 09:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because the rules can misclassify requested work, preserve test bypasses, and trigger destructive cleanup without explicit authorization.

1 open issue
2 resolved since last review

Review effort: Balanced (adaptive)

Copilot AI adaptive review requested due to automatic review settings November 21, 2026 14:16
@shauryagangrade

Copy link
Copy Markdown
Contributor Author

Addressed the latest Copilot review:

  • Replied on the open thread about the PR description: the PR body already reflects the package-free workflow (git + existing acceptance command only; no pinned PyPI/npm engine runs and no external alignment scores).
  • Tightened skills/intent-drift/SKILL.md classification to reduce misclassification: changes that implement the stated request or required security/input-validation constraints are treated as required even if the current acceptance check does not cover them; ambiguous cases require asking before reverting.
  • Strengthened the test rule to explicitly call out bypasses (broadening assertions, commenting out checks, skip/xfail/todo markers) unless explicitly requested, and to preserve/replace coverage when removing obsolete tests.
  • Made untracked-file cleanup non-destructive by default: only remove an out-of-scope untracked file if it was created in this task and is clearly not user-authored; otherwise keep it, report it, and ask before deleting.

Validation: npm run skill:validate (462 skills), npm run build, and bash .github/scripts/maintenance/fix-line-endings.sh (known pre-existing macOS sed noise; no intent-drift line-ending issues).

@aaronpowell

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The current procedure lacks a captured Copilot run on a real repository diff with verified classifications; the existing walkthrough is illustrative and the only recorded run uses a throwaway repository and earlier behavior.

1 open issue

Review effort: Balanced (adaptive)

@shauryagangrade

Copy link
Copy Markdown
Contributor Author

@aaronpowell

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk:high needs-review:HIGH Contributor reputation check flagged HIGH risk new-submission PR adds at least one new contribution requires-submitter-fixes Submission has quality-gate findings that submitter must fix before maintainer review skills PR touches skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants